package com.basics.organization.service.impl;

import com.basics.common.exception.CustomException;
import com.basics.organization.entity.CyOrganization;
import com.basics.organization.mapper.CyOrganizationMapper;
import com.basics.organization.service.CyOrganizationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 组织信息 服务实现类
 * </p>
 *
 * @author WangWei
 * @since 2025-03-09
 */
@Service
public class CyOrganizationServiceImpl extends ServiceImpl<CyOrganizationMapper, CyOrganization> implements CyOrganizationService {

    @Override
    public  boolean isCreateUser(Long userId,Long organizationId){
        CyOrganization organization = getById(organizationId);
        if(organization==null){
            throw new CustomException("组织ID错误");
        }
        return organization.getCreateUserId().equals(userId);
    }
}
